package com.zxm.ssm.service;

import com.github.pagehelper.PageInfo;
import com.zxm.ssm.entity.Product;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public interface ProductService {
    /**
     * 查询图书
     *
     * @return
     */
    @Transactional(readOnly = true)
    PageInfo<Product> findAllProducts(int pageNum, int pageSize);

    /**
     * 根据id查找
     */
    @Transactional(readOnly = true)
    Product findProductById(int id);

    /**
     * 删除图书
     */
    int deleteProduct(int id);

    /**
     * 修改图书
     */
    int updateProduct(Product product);

    /**
     * 添加图书
     */
    int insertProduct(Product product);


    /*舒龙*/
    @Transactional(readOnly = true)
    PageInfo<Product> findAllProduct(int pagNum, int pagSize);

}
